#obj = {'a' => 1, 'b' => 2}

class Foo
    def initialize()
        @a = 1
        @b = 2
    end

    attr_reader :a, :b
end

obj = Foo.new

num = 0
(0 .. 1000000).each do
    #num += obj['a'] + obj['b']
    num += obj.a + obj.b
end

puts num
